Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation - fixing "lone" else lines #59

Closed
wants to merge 1 commit into from

Conversation

yohannd1
Copy link
Contributor

Currently, "lone" else lines don't seem to indent properly. I'm trying to fix that.
Current progress on this branch (you should be able to =G from the first line and have the same result):

{
    if (cond) branchA()
else branchB(); // not properly indented yet
}

{
    if (cond) branchA()
    else branchB();

    if (cond)
        if (foo)
            blk: {
                break :blk branchA();
            }
        else
            branchB();
    else
        branchB();

    const val = if (cond) branchA();
    else branchB();

    const val = if (cond)
        branchA();
    else
        branchB();

    const val = if (cond) blk: {
        break :blk branchA();
    }
    else blk: {
        break :blk branchB();
    }
}

Suggestions are appreciated!

Also, the method I'm doing uses a for loop - I'm not sure if that's very efficient so that might be a thing to be changed later.

Very much a work in progress, but seems to be going well.
@yohannd1 yohannd1 marked this pull request as draft June 19, 2021 21:08
@haze
Copy link
Contributor

haze commented Mar 16, 2022

Are you still working on this? If not, I'd appreciate closing the issue and leaving the branch up for someone else to continue the work, and opening an issue with a description (if you want) edit: I see that you have it linked in the other PR

@yohannd1
Copy link
Contributor Author

Yeah... I was working on this the other day but I didn't really get anywhere. I think I'll make an issue for that then.
(And if the issue you mentioned is #42, that's not really related. That one is related to the PR #56)

@yohannd1
Copy link
Contributor Author

Done! Created #73. Closing this PR now.

@yohannd1 yohannd1 closed this Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants